home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
wantan1a
/
frmmain.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1999-09-05
|
10KB
|
279 lines
VERSION 5.00
Begin VB.Form frmMain
BackColor = &H80000005&
BorderStyle = 0 'None
Caption = "macro font converter"
ClientHeight = 2685
ClientLeft = 0
ClientTop = 0
ClientWidth = 3540
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmMain.frx":0000
LinkTopic = "Form1"
ScaleHeight = 2685
ScaleWidth = 3540
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame1
BackColor = &H80000012&
Height = 3255
Left = -240
TabIndex = 0
Top = -360
Width = 3855
Begin VB.CommandButton cmdConvert
BackColor = &H8000000E&
Caption = "convert"
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 2640
Style = 1 'Graphical
TabIndex = 9
Top = 2520
Width = 975
End
Begin VB.ComboBox cmbFonts
BackColor = &H80000009&
ForeColor = &H8000000E&
Height = 330
Left = 360
Sorted = -1 'True
TabIndex = 8
Text = "arial"
Top = 2520
Width = 2175
End
Begin VB.VScrollBar vsbFontSize
Height = 255
Left = 840
Max = 4
Min = 140
TabIndex = 6
Top = 2160
Value = 20
Width = 375
End
Begin VB.CheckBox chkItalic
BackColor = &H00000000&
Caption = "italic"
ForeColor = &H8000000E&
Height = 210
Left = 360
TabIndex = 5
Top = 1680
Width = 615
End
Begin VB.CheckBox chkBold
BackColor = &H00000000&
Caption = "bold"
ForeColor = &H8000000E&
Height = 210
Left = 360
TabIndex = 4
Top = 1440
Width = 615
End
Begin VB.CheckBox chkUnderline
BackColor = &H00000000&
Caption = "underline"
ForeColor = &H8000000E&
Height = 210
Left = 360
TabIndex = 3
Top = 1920
Width = 975
End
Begin VB.PictureBox picMacro
AutoRedraw = -1 'True
BackColor = &H00000000&
BeginProperty Font
Name = "Arial"
Size = 20.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000E&
Height = 855
Left = 360
ScaleHeight = 53
ScaleMode = 3 'Pixel
ScaleWidth = 213
TabIndex = 2
Top = 480
Width = 3255
End
Begin VB.TextBox txtText
BeginProperty Font
Name = "Arial"
Size = 20.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 1125
Left = 1440
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 1
Top = 1320
Width = 2175
End
Begin VB.Label lblFontSize
Alignment = 2 'Center
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
Caption = "20"
ForeColor = &H8000000E&
Height = 255
Left = 360
TabIndex = 7
Top = 2160
Width = 375
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'5.1.99 - after several requests for this, i decided that even though
'i felt something like this wasn't worth while, i decided to go ahead
'and do it anyway. honestly something like this is a novelty, but like
'i said, you guys wanted this. i guess its kind of cool. well it was
'for about 5 or 10 min anyway. honestly, i thought it would've been
'a little harder. oh well. either way, enjoy. if you have any questions
'or comments, feel free to contact me.
'dos@hider.com
'www.hider.com/dos
Private lngFontSize As Long
Private Sub chkBold_Click()
'in this sub we're checking to see if the bold checkbox is
'checked or unchecked. we will change the fontbold properties
'of our textbox and picturebox as well as redraw our text to
'the picturebox.
If chkBold.Value = vbChecked Then
txtText.FontBold = True
picMacro.FontBold = True
Else
txtText.FontBold = False
picMacro.FontBold = False
End If
Call TextToPictureBox(txtText, picMacro)
End Sub
Private Sub chkItalic_Click()
'this is the same as the bold checkbox. this time we're setting
'the italic properties.
If chkItalic.Value = vbChecked Then
txtText.FontItalic = True
picMacro.FontItalic = True
Else
txtText.FontItalic = False
picMacro.FontItalic = False
End If
Call TextToPictureBox(txtText, picMacro)
End Sub
Private Sub chkUnderline_Click()
'again, like the bold and italic checkboxes, we're setting another
'font property, this time the undline property.
If chkUnderline.Value = vbChecked Then
txtText.FontUnderline = True
picMacro.FontUnderline = True
Else
txtText.FontUnderline = False
picMacro.FontUnderline = False
End If
Call TextToPictureBox(txtText, picMacro)
End Sub
Private Sub cmbFonts_Click()
'in this sub, we're responding to the change of the font name
'in our combobox. a lot of this code looks unecessary, but it
'isn't. when different fonts are loaded, they may have a different
'size, be bolded, italic, etc. we must account for this and
'adjust our controls accordingly.
txtText.FontName = cmbFonts.Text
picMacro.FontName = cmbFonts.Text
vsbFontSize.Value = txtText.FontSize
lblFontSize.Caption = vsbFontSize.Value
If txtText.FontBold = True Then
chkBold.Value = vbChecked
Else
chkBold.Value = vbUnchecked
End If
If txtText.FontItalic = True Then
chkItalic.Value = vbChecked
Else
chkItalic.Value = vbUnchecked
End If
If txtText.FontUnderline = True Then
chkUnderline.Value = vbChecked
Else
chkUnderline.Value = vbUnchecked
End If
Call TextToPictureBox(txtText, picMacro)
End Sub
Private Sub cmdConvert_Click()
'in this button's event, we're calling to our convert function
'which converts the picture box to our ascii art